tinymce.create('tinymce.plugins.cnblogs_list_plugin', {
    init: function (ed, url) {
        ed.addCommand('cnblogs_insert_list', function () {
            selected = tinyMCE.activeEditor.selection.getContent();

            if (selected) {
                content = '[cnblogs]' + selected + '[/cnblogs]';
            } else {
                content = '[cnblogs]';
            }

            tinymce.execCommand('mceInsertContent', false, content);
        });

        console.log(url);
        ed.addButton('cnblogs_list_button', {
            title: 'Insert cnblogs list',
            cmd: 'cnblogs_insert_list',
            image: url + '/img/cnblogs.ico'
        });
    }
});
tinymce.PluginManager.add('cnblogs_list_button', tinymce.plugins.cnblogs_list_plugin);